<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get number of rows in result</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.fbsql-num-rows" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">fbsql_num_rows</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">fbsql_num_rows</span> &mdash; <span class="dc-title">Get number of rows in result</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.fbsql-num-rows-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>fbsql_num_rows</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$result</code></span>
   ) : <span class="type">int</span></div>

  <p class="para rdfs-comment">
   Gets the number of rows in the given <code class="parameter">result</code> set.
  </p>
  <p class="para">
   This function is only valid for SELECT statements. To retrieve the number
   of rows returned from a INSERT, UPDATE or DELETE query, use
   <span class="function"><a href="fbsql_affected_rows.html" class="function">fbsql_affected_rows()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.fbsql-num-rows-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    <dt>
<code class="parameter">
result</code></dt>
<dd>
<p class="para">由 <span class="function"><a href="fbsql_query.html" class="function">fbsql_query()</a></span>
或 <span class="function"><a href="fbsql_db_query.html" class="function">fbsql_db_query()</a></span> 返回的结果标识符。</p></dd>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.fbsql-num-rows-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the number of rows returned by the last SELECT statement.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.fbsql-num-rows-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-1222">
    <p><strong>Example #1 <span class="function"><strong>fbsql_num_rows()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$link&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fbsql_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"localhost"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fbsql_select_db</span><span style="color: #007700">(</span><span style="color: #DD0000">"database"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$link</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fbsql_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;table1;"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$link</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$num_rows&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fbsql_num_rows</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br /><br />echo&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$num_rows</span><span style="color: #DD0000">&nbsp;Rows\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.fbsql-num-rows-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="fbsql_affected_rows.html" class="function" rel="rdfs-seeAlso">fbsql_affected_rows()</a> - Get number of affected rows in previous FrontBase operation</span></li>
    <li class="member"><span class="function"><a href="fbsql_connect.html" class="function" rel="rdfs-seeAlso">fbsql_connect()</a> - Open a connection to a FrontBase Server</span></li>
    <li class="member"><span class="function"><a href="fbsql_select_db.html" class="function" rel="rdfs-seeAlso">fbsql_select_db()</a> - Select a FrontBase database</span></li>
    <li class="member"><span class="function"><a href="fbsql_query.html" class="function" rel="rdfs-seeAlso">fbsql_query()</a> - Send a FrontBase query</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>